package com.alks.yn_zs.controller;

import com.alks.common.aop.ApiRestController;
import com.alks.common.aop.WebLogger;
import com.alks.entity.data.response.ResponseInfo;
import com.alks.yn_zs.data.dto.DeptProDto;
import com.alks.yn_zs.data.dto.StatsDto;
import com.alks.yn_zs.data.request.StatsRequest;
import com.alks.yn_zs.service.IProdShowService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author MS
 * @since 2024/11/21上午8:47
 */
@RestController
@ApiRestController("/show/prod")
@Api(value = "生产", tags = "冲裁看板")
@Slf4j
public class ProdShowController {

    @Autowired
    private IProdShowService service;

    @WebLogger
    @GetMapping("/blank/cpc")
    @ApiOperation(value = "冲裁列表查询", tags = "冲裁看板")
    public ResponseInfo blankList() {
        return ResponseInfo.ok(service.blankList());
    }

    @WebLogger
    @PostMapping("/blank/stats")
    @ApiOperation(value = "冲裁列表查询", tags = "冲裁看板")
    public ResponseInfo blankStats(@RequestBody StatsRequest request) {
        List<StatsDto> dtoList = service.blankStats(request);
        return ResponseInfo.ok(dtoList);
    }

}